package com.example.CarManagement.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.example.CarManagement.enumPojo.ApplicationStatus;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用车申请表，记录用户提交的用车申请及审批状态
 * </p>
 *
 * @author 徐佳彪
 * @since 2025-07-17
 */
@TableName("c_applications")
public class Applications implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 申请ID，主键自增
     */
    private String id;

    /**
     * 申请单号，格式如APP-YYYYMMDD001，唯一
     */
    private String applicationNumber;

    /**
     * 申请人ID，关联users表
     */
    private String applicantId;


    /**
     * 出发地点
     */
    private String departureLocation;

    /**
     * 目的地
     */
    private String destination;

    /**
     * 计划开始时间
     */
    private LocalDateTime startTime;

    /**
     * 计划结束时间
     */
    private LocalDateTime endTime;

    /**
     * 乘车人数
     */
    private Integer passengers;

    /**
     * 是否需要司机
     */
    private Boolean needDriver;

    /**
     * 用车事由
     */
    private String purpose;

    /**
     * 申请状态：draft-草稿，pending-审批中，approved-已批准，rejected-已拒绝，dispatched-已派车，in_progress-进行中，completed-已完成，cancelled-已取消
     */
    private ApplicationStatus status;

    /**
     * 当前审批人ID，关联users表
     */
    private String currentApproverId;

    /**
     * 记录创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 记录最后更新时间
     */
    private LocalDateTime updatedAt;

    private Byte deleted;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getApplicationNumber() {
        return applicationNumber;
    }

    public void setApplicationNumber(String applicationNumber) {
        this.applicationNumber = applicationNumber;
    }

    public String getApplicantId() {
        return applicantId;
    }

    public void setApplicantId(String applicantId) {
        this.applicantId = applicantId;
    }


    public String getDepartureLocation() {
        return departureLocation;
    }

    public void setDepartureLocation(String departureLocation) {
        this.departureLocation = departureLocation;
    }

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public Integer getPassengers() {
        return passengers;
    }

    public void setPassengers(Integer passengers) {
        this.passengers = passengers;
    }

    public Boolean getNeedDriver() {
        return needDriver;
    }

    public void setNeedDriver(Boolean needDriver) {
        this.needDriver = needDriver;
    }

    public String getPurpose() {
        return purpose;
    }

    public void setPurpose(String purpose) {
        this.purpose = purpose;
    }

    public ApplicationStatus getStatus() {
        return status;
    }

    public void setStatus(ApplicationStatus status) {
        this.status = status;
    }

    public String getCurrentApproverId() {
        return currentApproverId;
    }

    public void setCurrentApproverId(String currentApproverId) {
        this.currentApproverId = currentApproverId;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Byte getDeleted() {
        return deleted;
    }

    public void setDeleted(Byte deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "Applications{" +
            "id = " + id +
            ", applicationNumber = " + applicationNumber +
            ", applicantId = " + applicantId +
            ", departureLocation = " + departureLocation +
            ", destination = " + destination +
            ", startTime = " + startTime +
            ", endTime = " + endTime +
            ", passengers = " + passengers +
            ", needDriver = " + needDriver +
            ", purpose = " + purpose +
            ", status = " + status +
            ", currentApproverId = " + currentApproverId +
            ", createdAt = " + createdAt +
            ", updatedAt = " + updatedAt +
            ", deleted = " + deleted +
        "}";
    }
}
